#!/bin/sh

COM_HOME=..

JARS="$COM_HOME/conf/"
LIB=$COM_HOME/lib
if [ -d $LIB ]; then
  for i in $LIB/*/*.jar; do
    JARS="$JARS":$i
  done
fi
if [ -d $LIB ]; then
  for i in $LIB/*.jar; do
    JARS="$JARS":$i
  done
fi
export JARS
case "$1" in
	'start')
	java -Xms256M -Xmx1024M -XX:MaxPermSize=256m -Dprogram.name=Compress -Djava.library.path=/usr/mqm/java/lib -Dfile.encoding=GBK -cp $JARS com.boco.dal.demo.compress.app.AppRun  
	;;
	'stop')
	ps -ef | grep "program.name=Compress"|grep -v grep|awk '{print $2}'|xargs -i kill -15 {}  
	;;
	*)
	echo "compress 1.0.1, boco ltd. (c)2010-2012"
	echo "usage: ./compress.sh <command>"
	echo "       command = < start | stop >"
	echo "       start: start amtransmitter in current shell, and in background if succeded with &."
	echo "              the program should be execute with root privelage."
	echo "       stop:  stop the running program."
	;;
esac
